# Contributor: Bhushan Shah <bshah@kde.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=telepathy-ofono
pkgver=0_git20210212
pkgrel=0
_commit="b9bfed49157fd16c4a3dc84d29bdc5656beba5c9"
pkgdesc="Telepathy oFono connection manager"
url="https://github.com/TelepathyIM/telepathy-ofono"
# s390x blocked by telepathy-mission-control-dev
# riscv64 disabled due to missing rust in recursive dependency
arch="all !s390x !riscv64"
license="LGPL-2.1-or-later"
depends="ofono"
makedepends="
	cmake
	libofono-qt-dev
	libphonenumber-dev
	qt5-qtbase-dev
	sqlite-dev
	telepathy-mission-control-dev
	telepathy-qt-dev
	"
checkdepends="dbus-test-runner"
source="https://github.com/TelepathyIM/telepathy-ofono/archive/$_commit/telepathy-ofono-$_commit.tar.gz"
options="!check" # Requires running ofono
builddir="$srcdir/$pkgname-$_commit"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DOFONO_ON_RING=ON
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="1b444d3ef3afef721c2703df6196bb3f48a3661ff764bf4a64d2170491a42f0a5cb795db0b0004f1ec03a57d252f1e603fbdc4bae34fae0eabd898700140085d  telepathy-ofono-b9bfed49157fd16c4a3dc84d29bdc5656beba5c9.tar.gz"
